﻿using System;
using SuggestionService;


namespace University
{
    public partial class AboutUniversity : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            SuggestionServiceClient client = new SuggestionServiceClient("BasicHttpBinding_ISuggestionService");
            var t = client.GetSuggestedTests("admin");
            
            
            /*var client = new SuggestionServiceClient("BasicHttpBinding_ISuggestionService");
                       
            var allUsers = client.GetAllUsers();
            var allQuizes = TestSystem.BLL.TestSystem.Quiz.GetAll(false, true);

            var userRand = new Random(DateTime.Now.Millisecond);
            var userCnt = allUsers.Length/3;
            
            for(int k = 0; k < userCnt; k++)
            {
                var curUser = allUsers[userRand.Next(0, userCnt - 1)];
                var rand = new Random(DateTime.Now.Millisecond);
                var count = rand.Next(1, allQuizes.Count - 20);
                for (int j = 0; j < count; j++)
                {
                    int idx = rand.Next(0, allQuizes.Count - 1);
                    var scoreRand = new Random(DateTime.Now.Millisecond);
                    var maxScores = allQuizes[idx].MaxScores;
                    TestSystem.BLL.TestSystem.QuizHistory.Add(allQuizes[idx].QuizID, curUser.UserId,
                                                                DateTime.Now,
                                                                DateTime.Now.AddDays(1),
                                                                maxScores - scoreRand.Next(1, maxScores - 2));
                }
            }*/

        }
    
    }
}
